package com.workmanager.service;

import com.workmanager.bean.EvaluateBean;
import com.workmanager.bean.FeedbackBean;
import com.workmanager.bean.StudentBean;
import com.workmanager.bean.TeacherBean;
import com.workmanager.mapper.TalkMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by haocongshun on 2016/9/9.
 */
@Service("talkService")
public class TalkService {
    @Resource(name="talkMapper")
    private TalkMapper talkMapper;

    public TalkMapper getTalkMapper() {
        return talkMapper;
    }

    public void setTalkMapper(TalkMapper talkMapper) {
        this.talkMapper = talkMapper;
    }

    public Map<String,Object> talk(String work_id){
        Map<String,Object> map = new HashMap<String,Object>();
        map.put("evaluate",getEvaluate(work_id));
        map.put("feedback",getFeedBack(work_id));
        map.put("teacher",getTeacher(work_id));
        map.put("student",getStudent(work_id));
        return map;
    }
    private List<EvaluateBean> getEvaluate(String work_id){
        return talkMapper.getEvaluate(work_id);
    }
    private List<FeedbackBean> getFeedBack(String work_id){
        return talkMapper.getFeedBack(work_id);
    }

    private TeacherBean getTeacher(String work_id){
        return talkMapper.getTeacher(work_id);
    }
    private StudentBean getStudent(String work_id){
        return talkMapper.getStudent(work_id);
    }

}
